<?php
echo "<script>alert('个人会员暂停注册');location='index.php'</script>";
include("../inc/global.inc");
if($_POST[act]){
   if($_SESSION[chkCode]==$_POST[c_code]){
    $sql="select * from member where m_user='$_POST[m_userid]'";
    $rs=mysql_query($sql);
    $row=@mysql_fetch_array($rs);
    if(!$row[id]){
       if($_POST[c_provinces]&&$_POST[c_city]){
	    $c_rs=@mysql_query("select * from city where id='$_POST[c_provinces]' and city_id=0");
		$c_row=@mysql_fetch_array($c_rs);
		$c_rs2=@mysql_query("select * from city where id='$_POST[c_city]' and city_id>0");
		$c_row2=@mysql_fetch_array($c_rs2);
		$c_rs3=@mysql_query("select * from city where id='$_POST[c_diqu]' and city_id>0");
		$c_row3=@mysql_fetch_array($c_rs3);
		$c_diqu=($_POST[c_diqu])?$_POST[c_diqu]:0;
	    
		$psw=substr(md5($_POST[m_password]),7,19);
		$tel=$_POST[phone_country]."-".$_POST[phone_area]."-".$_POST[phone_number];
		$ip=$_SERVER["REMOTE_ADDR"];
		
        @mysql_query("insert into member (m_mode,m_type,m_user,m_psw,m_name,m_sex,m_email,m_pro,pro,m_city,city,m_diqu,diqu,m_addre,m_tel,m_phone,m_qq,m_addtime,m_endtime,m_ip) values ('$_POST[m_mode]','$_POST[m_types]','$_POST[m_userid]','$psw','$_POST[m_people]','$_POST[m_sex]','$_POST[m_email]','$_POST[c_provinces]','$c_row[city_name]','$_POST[c_city]','$c_row2[city_name]','$c_diqu','$c_row3[city_name]','$_POST[m_addre]','$tel','$_POST[m_mobile]','$_POST[m_qq]','".date("Y-m-d H:i:s")."','".date("Y-m-d H:i:s")."','$ip')");
		
		
		  class Jmail
                     {
                     public $Username;
                     public $Password;
                     public $FormName;
                     public $From;
                     public $Addrecipient;
                     public $Ttile;
                     public $Content;
                     public $Smtp;
                   function Send(){
                       $Jmail = new com("Jmail.Message");
                       $Jmail->SiLent=true; //璁剧疆鎴怲rue鐨勮瘽Jmail涓嶄細鎻愮ず閿欒鍙細杩斿洖True鍜孎alse
                       $Jmail->LogGing =false;   //鏄惁寮€鍚棩蹇?
                       $Jmail->CharSet ="gb2312"; //璁惧畾瀛楃涓茬紪鐮?
                       $Jmail->ContentType = "Text/html"; //閭欢鐨勬牸寮忎负HTML鏍煎紡
                       $Jmail->MailServerUsername = $this->Username; //鍙戜俊绠辩敤鎴峰悕
                       $Jmail->MailServerPassword = $this->Password; //鍙戜俊绠卞瘑鐮?
                       $Jmail->FromName = $this->FromName;   //鍙戜欢浜哄鍚?
                       $Jmail->From = $this->From; //鍙戜欢浜哄湴鍧€
                       $Jmail->AddRecipient($this->Addrecipient); //鏀朵欢浜哄湴鍧€
                       $Jmail->Subject = $this->Title;//Email title
                       $Jmail->Body = $this->Content; //Email content
                       $JmailError = $Jmail->Send($this->Smtp); //Smtp
                             if($JmailError){ //sent is ok?
                                   return true;
                             }else{
                                   return false;
                             }
                        }
                     }
					 
					 
					 $content=iconv("utf-8","gb2312","<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN' 'http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd'>
<HTML xmlns='http://www.w3.org/1999/xhtml'>
<HEAD>
<TITLE>浼氬憳娉ㄥ唽涓夊笣璐告槗缃?/TITLE>
<META http-equiv=Content-Type content='text/html; charset=gb2312'>
<style type='text/css'>
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
	font-size: 12px;
	FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif;
	background-color: #FFFFFF;
}
a:link {
	color: #003399;
	text-decoration: underline;
}
a:hover {
	color: #FF6600;
	text-decoration: underline;
}
a:active {
	color: #003399;
	text-decoration: underline;
}
a:visited {
	color: #003399;
	text-decoration: underline;
}



#mail {
	padding: 0px;
	width: 622px;
	margin-top: 0px;
	margin-right: auto;
	margin-bottom: 0px;
	margin-left: auto;
	border-right-width: 1px;
	border-left-width: 1px;
	border-right-style: solid;
	border-left-style: solid;
	border-right-color: #ECE9D8;
	border-left-color: #ECE9D8;
}
#mail .info .to {
	line-height: 22px;
}

#mail .info .title {
	font-family: Arial;
	font-size: 19px;
	padding: 5px;
	background-color: #EBEBEB;
}

#mail .logo {
	float: left;
	padding-top: 13px;
}
#mail .headbg {
	float: right;
}
#mail .info {
	padding: 10px;
}
#mail .info .note {
	background-color: #ECF3FB;
	padding: 5px;
	line-height: 18px;
}

#mail .foot {
	background-color: #7EB1DA;
	padding: 6px;

	text-align: right;
}

.onl {
	clear: both;
}
-->
</style>
</HEAD>
<BODY>
<div id='mail'>
<div class='logo'><img src='http://www.sandib2b.cn/images/logo.gif' width='388' height='60'></div>
<div class='headbg'><img src='http://www.sandib2b.cn/images/headbg.gif' width='220' height='75'></div>
<div class='onl'></div>
<table width='100%' border='0' cellpadding='0' cellspacing='0'>
  <tr>
    <td height='42' align='right' valign='bottom' background='http://www.sandib2b.cn/images/webbg.gif'><img src='http://www.sandib2b.cn/images/messbg.gif' width='257' height='28'></td>
    </tr>
</table>
<div class='info'>
    <table cellspacing='0' cellpadding='0' width='100%' align='center' border='0'>
    <tbody>
      <tr>
        <td width='593' height='300' valign='top'><div><strong>鎮ㄥソ "."$_POST[m_people]"."("."$_POST[m_sex]".")</strong>
                <div class='to'>鐢ㄦ埛鍚?"."$_POST[m_userid]"."<br>
                  瀵嗙爜:$_POST[m_password]<br>
                  鎮ㄥ凡缁忔垚鍔熸敞鍐屼笁甯濊锤鏄撶綉涓汉浼氬憳.<br>鐧婚檰鍦板潃:<a href='http://www.sandib2b.cn/login/'>http://www.sandib2b.cn/login/</a><br><BR>
                  <br>
				  <BR>
                  <br>
				  <BR>
                  <br>
                  <A href='http://www.sandib2b.cn/' target='_blank'>http://www.sandib2b.cn</A>
				  <BR>
                  <br>
				  璀﹀憡锛氱郴缁熼偖浠惰鍕垮洖澶嶏紒
                </div>
          </div>
          </td>
      </tr>
    </tbody>
  </table>
</div>
<div class='foot'>鍥藉唴涓撲笟缃戜笂鍟嗗搧璐告槗骞冲彴<font color='#CC0000'>涓夊笣璐告槗缃?/font></div>
</div>
</BODY>
</HTML>");

                     $m="281022071@qq.com";
                     $jmail = new Jmail();
                     $jmail->Username = "admin@sandib2b.cn";
                     $jmail->Password = "s8886ao";
                     $jmail->FromName ="sandib2b.cn";
                     $jmail->From = "admin@sandib2b.cn";
                     $jmail->Addrecipient =$_POST[m_email];
                     $jmail->Title = iconv("utf-8","gb2312","浼氬憳娉ㄥ唽涓夊笣璐告槗缃?);
                     $jmail->Content = "$content";
                     $jmail->Smtp = "115.239.227.190";
                     $jmail->Send();
		
          echo "<script>alert('娉ㄥ唽鎴愬姛锛岃鐧诲綍');location='/login/';</script>";
		
		}else{
		echo "<script>alert('璇烽€夋嫨鐪佷唤鍜屽煄甯?);location='javascript:history.go(-1)';</script>";
		}
	}else{
               echo "<script>alert('璇ヨ处鍙峰凡缁忓瓨鍦?);location='javascript:history.go(-1)';</script>";
	}

    }else{
       echo "<script>alert('楠岃瘉鐮侀敊璇?);location='javascript:history.go(-1)';</script>";
    }
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>涓汉浼氬憳娉ㄥ唽-涓夊笣璐告槗缃?/title>
<link href="/css/body.css" rel="stylesheet" type="text/css" />
<link href="/css/head_2.css" rel="stylesheet" type="text/css" />
<link href="/css/foot.css" rel="stylesheet" type="text/css" />
<link href="css/join.css" rel="stylesheet" type="text/css" />
<script language="javascript" src="js/join.js" type="text/javascript" charset="gb2312"></script>
<script language="javascript" src="/js/city.js" type="text/javascript" charset="gb2312"></script>
</head>
<body>
<?php include("../inc/head_top.php")?>
<div class="top1 topside6">
<div style="float:left;width:388px;"><a href="/"><img src="/images/logo.gif" border="0"/></a></div>
<div class="onl"></div>
</div>
<div class="onl"></div>
<form method="post" action="" onsubmit="return checkform()" name="form1">
<input type="hidden" name="m_types" value="3" />
<input type="hidden" name="m_mode" value="2" />
<div id="mian" class="topside6 sideyellow1">
<div class="title3 size12">灏婃暚鐨勬柊浼氬憳鎮ㄥソ锛屾杩庢偍娉ㄥ唽涓夊笣璐告槗缃戯紒 瀹㈡湇鐑嚎:0551-7115928
  <div class="onl"></div>
</div>
<div class="content size14">
  <table width="100%" border="0" cellpadding="0" cellspacing="0">
    <tr>
      <td width="50%" valign="top" bgcolor="#F4F4F0" style="line-height:20px; padding-left:15px;"><strong>浼佷笟浼氬憳娉ㄥ唽锛?/strong><br />
        1.鍏嶈垂娉ㄥ唽锛?.鍏嶈垂鍙戝竷淇℃伅锛?.鍙戝竷鎷涜仒淇℃伅銆?br />
        4.鏌ョ湅鎷涙爣淇℃伅锛?.涓嬭浇涓夊笣璧勬枡锛?.寤虹珛鑷繁鐨勪紒涓氬晢閾恒€?br />
        7.涓婁紶鍏徃璇佷欢銆?/td>
      <td width="50%" valign="top" bgcolor="#F4F4F0" style="line-height:20px;"><strong>涓汉浼氬憳娉ㄥ唽锛?/strong><br />
        1.涓嬭浇涓夊笣璧勬枡锛?br />
        2.鏌ョ湅鎷涙爣淇℃伅锛?br />
        3.姹傝亴銆?</td>
    </tr>
  </table>
  <table width="100%" height="112" border="0" cellpadding="0" cellspacing="0" class="table">
    <tbody>
      <tr>
        <td width="20%" height="28" align="right" bgcolor="#F4F4F0">娉ㄥ唽浼氬憳绫诲瀷<span class="fontred"> *</span></td>
        <td height="28" colspan="2" bgcolor="#F4F4F0" class="size14"><a href="index.php"><input type="radio" onClick="window.open('index.php','_self')"/>浼佷笟浼氬憳娉ㄥ唽</a>&nbsp;&nbsp;&nbsp;&nbsp;<a href="personal.php"><input type="radio" checked="checked" onClick="window.open('personal.php','_self')"/>涓汉浼氬憳娉ㄥ唽</a></td>
      </tr>
      <tr>
        <td width="20%" height="28" align="right" >浼氬憳鐧诲綍鍚?span class="fontred"> * </span></td>
        <td width="42%" height="28" ><input name="m_userid" type="text" class="input1" id="m_userid" size="35" maxlength="40" onChange="callServer();"/>&nbsp;<span id="test1"></span></td>
        <td width="38%" ><div class="txt">浼氬憳鐧诲綍鍚嶇敱6-20涓嫳鏂囧瓧姣嶆垨鏁板瓧缁勬垚(涓嶆敮鎸佷腑鏂?銆備竴鏃︽敞鍐屾垚鍔燂紝涓嶅彲淇敼銆?/div></td>
      </tr>
      <tr>
        <td width="20%" height="28" align="right" bgcolor="#F4F4F0" >瀵嗐€€銆€鐮?span class="fontred"> *</span></td>
        <td width="42%" height="28" bgcolor="#F4F4F0">
		<input name="m_password" type="password" class="input1" id="m_password" size="35" maxlength="40" /></td>
        <td width="38%" height="28" bgcolor="#F4F4F0"><div class="txt">瀵嗙爜鐢?浠ヤ笂瀛楃缁勬垚锛屽缓璁噰鐢ㄦ槗璁般€侀毦鐚滅殑鑻辨枃鏁板瓧缁勫悎銆?/div></td>
      </tr>
      <tr>
        <td width="20%" height="28" align="right" >纭瀵嗙爜<span class="fontred"> *</span></td>
        <td width="42%" height="28" ><input name="m_password2" type="password" class="input1" id="m_password2" size="35" maxlength="40" /></td>
        <td width="38%" height="28" ><div class="txt">璇峰啀杈撳叆涓€閬嶆偍涓婇潰濉啓鐨勫瘑鐮併€?/div></td>
      </tr>
    </tbody>
  </table>
  <div class="title2 b">濮撳悕鍜岃仈绯绘柟寮?/div>
  <table width="100%" border="0" cellpadding="0" cellspacing="0" class="table">
    <tbody>
      <tr>
        <td width="20%" align="right" bgcolor="#F4F4F0" ><span class="text">鐪熷疄濮撳悕</span><span class="fontred"> *</span></td>
        <td width="42%" bgcolor="#F4F4F0"><input name="m_people" class="input1" id="m_people" size="35" /></td>
        <td width="38%" bgcolor="#F4F4F0"><div class="txt">璇疯緭鍏ュ叏鍚?/div></td>
      </tr>
      <tr>
        <td width="20%" align="right" ><span class="text">绉板懠</span><span class="fontred"> *</span></td>
        <td colspan="2" >
		 <input id="m_sex" name="m_sex" type="radio" value="鍏堢敓" checked="checked"> 鍏堢敓
		 <input id="m_sex" name="m_sex" type="radio" value="濂冲＋"> 濂冲＋
		 <input id="m_sex" name="m_sex" type="radio" value="灏忓"> 灏忓</td>
      </tr>
      <tr>
        <td width="20%" align="right" bgcolor="#F4F4F0" ><span class="text">鐢靛瓙閭<span class="fontred"> *</span></span></td>
        <td bgcolor="#F4F4F0" ><input name="m_email" class="input" id="m_email" size="35" /></td>
        <td bgcolor="#F4F4F0" ><div class="txt">闈炲父閲嶈锛?/div></td>
      </tr>
      <tr>
        <td align="right" ><span class="text">鍏徃鎵€鍦ㄥ湴</span><span class="fontred"> *</span></td>
        <td colspan="2" >
		<select  name="c_provinces" id="c_provinces" onChange="changecity(document.form1.c_provinces.options[document.form1.c_provinces.selectedIndex].value)">
            <option value="">--閫夋嫨鐪佷唤--</option>
          <?php
          $result = mysql_query("select * from city where city_id=0");    
          while($res = mysql_fetch_array($result)){    
          ?>    
          <option value="<?=$res[id]?>"><?=$res[city_name]?></option> 
          <?php }?>   
       </select>
       <select name="c_city" id="c_city" onChange="changecity2(document.form1.c_city.options[document.form1.c_city.selectedIndex].value)">
            <option value="">--閫夋嫨鍩庡競--</option>
       </select>
	   <select name="c_diqu" id="c_diqu">
            <option value="">--閫夋嫨鍦板尯--</option>
       </select></td>
        </tr>
	  <tr>
        <td width="20%" align="right" bgcolor="#F4F4F0" ><span class="text">鑱旂郴鍦板潃</span><span class="fontred"> *</span></td>
        <td colspan="2" bgcolor="#F4F4F0" ><input name="m_addre" id="m_addre" type="text" class="input" maxlength="100"/></td>
      </tr>
      <tr>
        <td width="20%" align="right" ><span class="text">鍥哄畾鐢佃瘽</span></td>
        <td colspan="2">鍥藉鍖哄彿&nbsp;鍖哄彿&nbsp; 鐢佃瘽鍙风爜<br />
          <input class="input2" id="phone_country" maxLength="8" size="5" value="86" name="phone_country"> 
            <input class="input2" id="phone_area" maxLength="8" size="5" name="phone_area"> 
            <input class="input1" id="phone_number" maxLength="100" size="17" name="phone_number"></td>
      </tr>
      <tr>
        <td width="20%" align="right" bgcolor="#F4F4F0" ><span class="text">鎵嬫満<span class="fontred"> *</span></span></td>
        <td bgcolor="#F4F4F0" ><input name="m_mobile" class="input" id="m_mobile" size="35" /></td>
        <td bgcolor="#F4F4F0" >&nbsp;</td>
      </tr>
      <tr>
        <td width="20%" align="right" ><span class="text">鍗虫椂閫?nbsp;&nbsp;</span></td>
        <td ><input name="m_qq" class="input" id="m_qq" size="35" /></td>
        <td ><div class="txt">MSN鎴朡Q</div></td>
      </tr>
      <tr>
        <td align="right" bgcolor="#F4F4F0" >楠岃瘉鐮?span class="fontred"> *</span></td>
        <td colspan="2" bgcolor="#F4F4F0" ><input name="c_code" class="input2" id="c_code" size="8" maxlength="6" />&nbsp;<img src="/inc/chk_num.php" align="absmiddle" id="img"/>&nbsp;<a href="#" name="test" id="test">鐪嬩笉娓呮锛?/a></td>
        </tr>
    </tbody>
  </table>
  <table width="100%" border="0" cellpadding="0" cellspacing="0" class="table">
    <tbody>
      <tr>
        <td colspan="3" align="center" ><div class="content">  <span class="fontgreen"><a 
class="news_trade" href="/about/" 
target="_blank">鐐规闃呰涓夊笣璐告槗缃戜細鍛樻湇鍔℃潯娆?/a></span><br />
          <input type="hidden" name="act" value="sandib2b.cn" />
                <input name="Submit" type="submit" class="inputbutt" value="鍚屾剰鏈嶅姟鏉℃锛屾彁浜ゆ敞鍐屼俊鎭? />
                <br /><span class="fontgray">濡傛灉鎮ㄤ笉鑳芥甯告敞鍐岋紝璇风偣姝や笅杞芥枃妗ｏ紝鎴戜滑甯偍娉ㄥ唽銆?/span><br />
        </div></td>
      </tr>
    </tbody>
  </table>
</div></div></form>
<div id="foot" class="footside">
<?php include("../inc/foot.php");?>
</div>
</body>
</html>
<script language="javascript">
function $(id){
return document.getElementById(id);
}
function checkform(){

 if($("m_userid").value.length>50||$("m_userid").value.length<6){
    alert("璇锋寜鐓ц姹傝緭鍏ヤ細鍛樼櫥褰曞悕");
    $("m_userid").focus();
    return false;
 }
 
 
if($("m_userid").value!="")
 	 {
 	  	var temp = unisch($("m_userid").value)
		if(temp==true)
		{
		    alert("璇锋寜鐓ц姹傝緭鍏ヤ細鍛樼櫥褰曞悕");
			$("m_userid").focus();
			return false;
		}
 	 }

	 
 if($("m_password").value.length<6){
    alert("璇疯緭鍏ュ瘑鐮?);
    $("m_password").focus();
    return false;
 }

if($("m_password2").value!=$("m_password").value){
alert("鎮ㄤ袱娆¤緭鍏ョ殑瀵嗙爜涓嶄竴鑷?);
$("m_password2").focus();
return false;
}


if($("m_people").value==""){
alert("璇疯緭鍏ユ偍鐨勭湡瀹炲鍚?);
$("m_people").focus();
return false;
}

var pattern = /^([a-zA-Z0-9_.-])+@([a-zA-Z0-9_-])+(.[a-zA-Z0-9_-])+/;
銆€銆€銆€銆€if(!pattern.test($("m_email").value)){
			alert("璇疯緭鍏ユ偍鐨凟-mail鍦板潃");
			$("m_email").focus();
			return false;
		}


if($("c_provinces").value==""){
alert("璇烽€夋嫨鎮ㄧ殑鐪佷唤");
$("c_provinces").focus();
return false;
}

if($("c_city").value==""){
alert("璇烽€夋嫨鎮ㄧ殑鍩庡競");
$("c_city").focus();
return false;
}

if($("m_addre").value==""){
alert("璇疯緭鍏ヨ仈绯诲湴鍧€");
$("m_addre").focus();
return false;
}

if($("m_mobile").value==""){
alert("璇疯緭鍏ユ墜鏈哄彿鐮?);
$("m_mobile").focus();
return false;
}

if($("c_code").value.length!=5){
  alert("璇疯緭鍏ユ偍鐨勯獙璇佺爜");
  $("c_code").focus();
  return false;
}

}

function unisch(String) 
{ 
	var Letters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-"; 
	var i; 
	var c; 
	for( i = 0; i < String.length; i ++ ) 
	{ 
		c = String.charAt( i ); 
		if (Letters.indexOf( c ) ==-1) 
		{ 
			return true; 
		} 
	} 
	return false; 
} 

function test(img){
    var src=img.getAttribute("src");
    src=src+"?new="+Math.random(0,10);
    img.setAttribute("src",src);
}
function prepare(){
    var nav=document.getElementById("test");
    var name=nav.getAttribute("name");
    var str="test";
    if(name==str){
        nav.onclick=function(){
            var img=document.getElementById("img");
            test(img);
            return false;
        }
    }
}
window.onload=prepare;
</script>